{% extends "base.html" %}
{% load staticfiles %}

{% block page_content %}
<section class="content-header" style="padding-top:0px" xmlns="http://www.w3.org/1999/html">
<div class="row">
    <div class="box box-info">
        <div class="box-header">
            <h2>Annotations</h2>
        </div>
    </div>
</div>
</section>
<section class="content">
    <div class="row">
    <div class="col-sm-2">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h4>Annotations</h4>
            </div>
            <div class="box-body text-right">
                <h3>{{ annotations_count }}</h3>
            </div>
        </div>
    </div>
    <div class="col-sm-2">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h4>Labels</h4>
            </div>
            <div class="box-body text-right">
                <h3>{{ labels_count }}</h3>
            </div>
        </div>
    </div>
    <div class="col-lg-3 col-md-6 col-sm-8">
    </div>
    </div>
    <div class="row">
    <div class="col-lg-12 col-md-12 col-sm-12">
        <div class="box box-primary">
            <div class="box-header with-border">
                <h4>Label stats</h4>
            </div>
            <div class="box-body">
                <table class="table dataTables">
                    <thead>
                    <tr>
                        <th>Label</th>
                        <th>Source</th>
                        <th>Hidden</th>
                        <th>Annotations count</th>
                        <th>Frame count</th>
                        <th>Video count</th>
                        <th>View</th>
                        <th>VDN Parent</th>
                        <th>Created</th>
                    </tr>
                    </thead>
                    <tbody>
                    {% for label in label_stats %}
                        <tr>
                            <td>{{ label.label_name }}</td>
                            <td>{{ label.source }}</td>
                            <td>{{ label.hidden }}</td>
                            <td class="text-right">{{ label.total }}</td>
                            <td class="text-right">{{ label.frame_count }}</td>
                            <td class="text-right">{{ label.video_count }}</td>
                            <td class="text-center"><a href="/annotations/label/{{ label.pk }}">View</a></td>
                            <td class="text-center">{% if label.vdn_dataset %}True{% else %}False{% endif %}</td>
                            <td class="text-center">{{ label.created }}</td>
                        </tr>
                    {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    </div>
</section>
{% endblock %}
{% block page_js%}
<script>
    $(document).ready(function() {
        InitializeTables();
    })
</script>
{% endblock %}
